using System.Threading.Tasks;
using DealerPlatform.Core.Repository;
using DealerPlatform.Domain;

namespace DealerPlatform.Service.CustomerApp
{
    public partial class CustomerService : ICustomerService
    {
        private readonly IRepository<Customer> RepoCustomer;
        private readonly IRepository<CustomerInvoice> RepoCustomerInvoice;
        private readonly IRepository<CustomerPwd> RepoCustomerPwd;
        public CustomerService(IRepository<Customer> repoCustomer, IRepository<CustomerInvoice> repoCustomerInvoice, IRepository<CustomerPwd> repoCustomerPwd)
        {
            RepoCustomer = repoCustomer;
            RepoCustomerInvoice = repoCustomerInvoice;
            RepoCustomerPwd = repoCustomerPwd;
        }

        public async Task<Customer> GetCustomerAsync(string customerNo)
        {
            return await RepoCustomer.GetAsync(c=>c.CustomerNo == customerNo);
        }
    }
}